package com.heima.api.wemedia;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 文章fen接口
 */
@FeignClient(value = "leadnews-wemedia")
public interface WemediaClient {

    @PostMapping("/wm/newUser")
    ResponseResult newUser(@RequestBody WmUser wmUser);


    /**
     * 分页查询根据状态和标题
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/list_vo")
    PageResponseResult listByStatusAndTitle(@RequestBody NewsAuthDto dto);

    /**
     * 根据id查询新闻
     *
     * @return
     */
    @GetMapping("/api/v1/news/one_vo/{id}")
    public ResponseResult quireById(@PathVariable Integer id);

    /**
     * 人工审核:审核不通过
     *
     * @return
     */
    @PostMapping("/api/v1/news/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDto dto);

    /**
     * 人工审核:审核通过
     *
     * @return
     */
    @PostMapping("/api/v1/news/auth_pass")
    public ResponseResult authPass(@RequestBody NewsAuthDto dto);



    /**
     * 敏感词分页查询
     */
    @PostMapping("/sensitive/list")
    ResponseResult findList(WmSensitiveDto dto);

    /**
     * 敏感词新增
     */
    @PostMapping("/sensitive/save")
    ResponseResult insert(WmSensitive wmSensitive);

    /**
     * 敏感词更新
     */
    @PostMapping("/sensitive/update")
    ResponseResult updateSeneitive(WmSensitive wmSensitive);

    /**
     * 敏感词删除
     */
    @DeleteMapping("/sensitive/del/{id}")
    ResponseResult delete(@PathVariable("id") Integer id);

    //    频道管理
    @GetMapping("/api/v1/channel/del/{id}")
    public ResponseResult deletea(@PathVariable Integer id);
    @PostMapping("/api/v1/channel/list")
    public ResponseResult list(@RequestBody WmChannelDto dto);
    @PostMapping("/api/v1/channel/save")
    public ResponseResult save(@RequestBody WmChannel wmChannel);
    @PostMapping("/api/v1/channel/update")
    public ResponseResult update(@RequestBody WmChannel wmChannel);

}
